/**
 * 
 */
package PushToPhone;

import java.util.ArrayList;

import SOAPMisc.statusAXLRequest.typeStatus;

import utils.variable;

/**
 * @author a.ratel
 *
 */
public class travailleur extends Thread
	{
	/**
	 * Variables 
	 */
	private int i;
	
	
	public travailleur(int index)
		{
		this.i = index;
		
		start();
		}
	
	
	public void run()
		{
		try
			{
			String ipPhone = ((statusPushRequest)variable.getSarl().get(i)).getPhoneIP();
			ArrayList<String> URI = ((statusPushRequest)variable.getSarl().get(i)).getURI();
			
			for(int a=0; a<URI.size(); a++)
				{
				new push2Phone(ipPhone,i,URI.get(a));
				}
			variable.getSarl().get(i).setAxlAnswerStatus(typeStatus.success);
			}
		catch (Exception exc)
			{
			exc.printStackTrace();
			variable.getLogger().error(exc);
			variable.getLogger().error("ERROR : "+exc.getMessage());
			variable.getSarl().get(i).setAxlAnswerStatus(typeStatus.error);
			}
		}
	
	
	
	}
